package gui;

import java.awt.Dimension;
import java.io.File;

import javax.swing.*;

import bot.DataStorage;
import bot.FileStorage;

public class BotGui {
	
	public final static DataStorage data = new FileStorage(new File("c:\\Users\\Jamison\\Documents\\PopulationInfo\\IowaData.txt"));
	public final static File past = new File("c:\\Users\\Jamison\\Documents\\PopulationInfo\\Iowa.txt");
	public final static File linksToDo = new File("c:\\Users\\Jamison\\Documents\\PopulationInfo\\IowaLinks.txt");
	public final static File linksDone = new File("c:\\Users\\Jamison\\Documents\\PopulationInfo\\MarylandLinksDone.txt");
	public final static File exceptions = new File("c:\\Users\\Jamison\\Documents\\PopulationInfo\\Exceptions.txt");
	public final static File textRemoval = new File("c:\\Users\\Jamison\\Documents\\PopulationInfo\\TextRemoval.txt");
	//for pages that need their 2000 data fished out of their history and added to the page
	public final static File dataNeeded = new File("c:\\Users\\Jamison\\Documents\\PopulationInfo\\DataNeeded.txt");
	public final static File headerNeeded = new File("c:\\Users\\Jamison\\Documents\\PopulationInfo\\HeaderNeeded.txt");
	public final static File geoBox = new File("c:\\Users\\Jamison\\Documents\\PopulationInfo\\GeoBox.txt");
	public final static File citiesNotFound = new File("c:\\Users\\Jamison\\Documents\\PopulationInfo\\CitiesNotFound.txt");
	public final static String state = "Maryland";
//	public final static String summary = "Update to 2010 census data (automatic).";
//	public final static String summary = "Update to 2010 census data (manually assisted).";
//	public final static String summary = "Update to 2012 population estimate and requested cleanup (automatic).";
	public final static String summary = "Update to 2012 population estimate and requested cleanup (manually assisted).";
	public final static String refDate = "2013-07-06";
	public final static int editToDo = 430;
	public final static int height = 285;
	public final static int heightCityPage = 130;
	
	public BotGui(){
		JFrame frame = new JFrame();
		frame.setSize(300, 500);
		JPanel panel = new JPanel();
		panel.setLayout(new BoxLayout(panel, BoxLayout.Y_AXIS));
		//text field for the city name
		JTextField name = new JTextField();
		name.setMaximumSize(new Dimension(500, 25));
		JLabel nameLabel = new JLabel("Url: ");
		JToolBar nameBar = new JToolBar();
		nameBar.setMaximumSize(new Dimension(550, 25));
		nameBar.setFloatable(false);
		nameBar.add(nameLabel);
		nameBar.add(name);
		//text field for date the resources were retreived
		JTextField date = new JTextField();
		date.setMaximumSize(new Dimension(500, 25));
		date.setText(refDate);
		JLabel dateLabel = new JLabel("Date: ");
		JToolBar dateBar = new JToolBar();
		dateBar.setMaximumSize(new Dimension(550, 25));
		dateBar.setFloatable(false);
		dateBar.add(dateLabel);
		dateBar.add(date);
		//text area for paste of all code
		JTextArea code = new JTextArea();
		JScrollPane scroll = new JScrollPane(code);
		//demographics button
		DemographicButton demographics = new DemographicButton(name, date);
		//side panel button
		PopulationSidePanelButton popSide = new PopulationSidePanelButton(name, date);
		//population button
		PopulationButton pop = new PopulationButton(name);
		//add a clear button for url
		ClearButton clear = new ClearButton(name, code);
		//add the area button
		AreaSidePanelButton area = new AreaSidePanelButton(name, date);
		//add the geo button
		GeoSentenceButton geo = new GeoSentenceButton(name, date);
		//add table button
		TableButton table = new TableButton(name);
		//test button
		AutoButton auto = new AutoButton(name, date, code);
		//full auto test button
		FullAutoButton fullAuto = new FullAutoButton(name, date, code);
		CleanupButton cleanup = new CleanupButton(name, date, code);

		
		panel.add(nameBar);
		panel.add(dateBar);
		panel.add(demographics);
		panel.add(popSide);
		panel.add(area);
		panel.add(pop);
		panel.add(geo);
		panel.add(table);
		panel.add(cleanup);
		panel.add(clear);
//		panel.add(auto);
		panel.add(fullAuto);
		panel.add(scroll);
		frame.add(panel);
		frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		frame.setVisible(true);
	}
}
